import type { Hot } from "./useHot";
import type { HistoryItemProps } from "./useHistory";
import type { ChatItemProps } from "@/components/Chat/chat.vue";
import { onMounted, ref } from "vue";
import { getCaseTypeList } from "@/api/zixun";
import useHot from "./useHot";

interface AI {
  hotList: Array<Hot>;
  historyList: Array<HistoryItemProps>;
  chatList: Array<ChatItemProps>;
  chatInset: {
    robot: ChatItemProps;
    user: ChatItemProps;
  };
}

interface Tab {
  id: number;
  name: string;
  short_name: string;
}
export default function useIndex() {
  const tabs = ref<Array<Tab>>([]);
  const tabIndex = ref(0);

  const ai = ref<Record<number, AI>>({});

  const { getThree, getHotList } = useHot();

  onMounted(() => {
    getCaseTypeList().then((res: any) => {
      if (res.data.data) {
        tabs.value = res.data.data;
        const id = tabs.value[0].id;
      }
    });
  });

  return {
    tabs
  };
}
